package com.hk.kindheartedness;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ImageButton;
import android.widget.Spinner;
import android.widget.Toast;

import com.hk.kindheartedness.db.DBOpenHelper;
import com.hk.kindheartedness.util.ToastUtil;

/**
 * 患者首页业务处理
 */
public class PatientIndexActivity extends AppCompatActivity implements View.OnClickListener {

    //    Initialize Toast
    private Toast toast;

    //    Initialize intent
    private Intent intent;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_patient_index);
        ImageButton hospitalBtn = findViewById(R.id.hospitalBtn);
        ImageButton doctorBtn = findViewById(R.id.doctorBtn);
        ImageButton departmentsBtn = findViewById(R.id.departmentsBtn);
        ImageButton operateBtn = findViewById(R.id.operateBtn);
        ImageButton goToADoctorBtn = findViewById(R.id.goToADoctorBtn);
        hospitalBtn.setOnClickListener(this);
        doctorBtn.setOnClickListener(this);
        departmentsBtn.setOnClickListener(this);
        operateBtn.setOnClickListener(this);
        goToADoctorBtn.setOnClickListener(this);

    }

    /**
     * 按钮点击事件
     * @param v
     */
    @Override
    public void onClick(View v) {
        switch (v.getId()) {
//            医院概述
            case R.id.hospitalBtn:
                intent = new Intent(PatientIndexActivity.this,HospitalActivity.class);
                startActivity(intent);
                break;
//                医生介绍
            case R.id.doctorBtn:
                intent = new Intent(PatientIndexActivity.this,PatientQueryDoctorActivity.class);
                startActivity(intent);
                break;
//                科室介绍
            case R.id.departmentsBtn:
                intent = new Intent(PatientIndexActivity.this,PatientDepartmentsActivity.class);
                startActivity(intent);
//                toast = ToastUtil.toastHint(toast,PatientIndexActivity.this,"功能暂未开放,敬请期待！");
                break;
            case R.id.operateBtn:
                intent = new Intent(PatientIndexActivity.this,PatientOperateActivity.class);
                startActivity(intent);
                break;
            case R.id.goToADoctorBtn:
                intent = new Intent(PatientIndexActivity.this,PatientGoToADoctorActivity.class);
                startActivity(intent);
//                toast = ToastUtil.toastHint(toast,PatientIndexActivity.this,"功能暂未开放,敬请期待！");
                break;
            default:
        }
    }
}